package com.codeoss.framework.db.table;

import java.util.List;

import org.springframework.stereotype.Service;

import com.codeoss.framework.context.YunContext;
import com.codeoss.framework.data.metadata.Query;
import com.codeoss.framework.data.metadata.Table;

@Service
public class PostgresqlTableService extends AbstractTableService {
	public String getPageSQL(YunContext yunContext, Table table, List<String> columnList, Query query) {
		String sql=getSelectSQL(yunContext, table, columnList, query);
		int offset=(query.getPage()-1)*query.getLimit();
		sql+=" limit "+query.getLimit()+" offset "+offset;
		return sql;
	}
}
